﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.Providers;

namespace MethodWorx.CMS.Plugins.StarterTemplates
{
    public class StarterTemplatesPlugin : IAutoLoadedPlugin, ISchemaDesignPlugin
    {
        static ToolbarIdeExtension starterTemplates;

        static StarterTemplatesPlugin()
        {
            starterTemplates = new ToolbarIdeExtension()
            {
                Text = "Starter Templates",
                Icon = "~/Images/Icons/star.png",
                Id = new Guid("{7079930E-35C2-44B1-826F-3C5A09A2A6C5}"),
                DisplayName = "Starter Templates",
                Controller = typeof(StarterTemplatesController),
                WebEditor = new AssemblyResourceReference(typeof(StarterTemplatesPlugin).Assembly, "Plugins/Views/StarterTemplates/StarterTemplates.ascx"),
            };
        }


        public Guid Id
        {
            get { return new Guid("{CE0DA320-F450-4780-A34F-117126845D6B}"); }
        }

        public string Name
        {
            get { return "Starter Templates"; }
        }

        public string Description
        {
            get { return "Install and use Starter Templates"; }
        }

        public IEnumerable<IdeExtension> GetIdeExtensionsForPageTemplate(Content.PageTemplate template)
        {
            return new IdeExtension[] { };
        }

        public IEnumerable<IdeExtension> GetIdeExtensionsForPage(Content.Page page)
        {
            return new IdeExtension[] { };
        }

        public IEnumerable<IdeExtension> GetIdeExtensions()
        {
            yield return starterTemplates;
        }

        public IEnumerable<ToolbarIdeExtension> GetToolbarIdeExtensions()
        {
            yield return starterTemplates;
        }

        private ICmsDataProvider provider;
        public void SetProvider(ICmsDataProvider provider)
        {
            this.provider = provider;
        }
    }
}
